<%--
*
* 作者： Sky
*
* 描述： 功能授权
*
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.toncen.samepms.system.dao.FunctionPermissionDao"/>
<%@include file="/share/header.jsp"%>
<%
	String subjectType=request.getParameter("subjectType");
	String subjectId=request.getParameter("subjectId");
	String resourceType=request.getParameter("resourceType");
	String[] resourceIds=request.getParameterValues("resourceIds");
	if(resourceIds==null){
		resourceIds=request.getParameterValues("resourceIds[]");	
	}
	FunctionPermissionDao functionPermissionDao=new FunctionPermissionDao();	
	try{
		functionPermissionDao.beginTransaction();
		functionPermissionDao.saveFunctionPermissionsBySubject(subjectType,Long.parseLong(subjectId),resourceType,resourceIds);
		functionPermissionDao.commitTransaction();
	}catch(Exception e){
		functionPermissionDao.rollback();
		throw e;
	}finally{
		functionPermissionDao.endTransaction();
	}
%>